<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl('/public/templates/default/css/tango/skin.css'); ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl('/public/templates/default/css/stickytooltip.css'); ?>" />
<script type="text/javascript" src="<?php echo $this->baseUrl('/public/templates/default/js/jquery.jcarousel.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl('/public/templates/default/js/stickytooltip.js'); ?>"></script>
<script type="text/javascript">
    $(document).ready(function() {
        $('#mycarousel').jcarousel();
    });
    $(document).on('click', '#book-tour', function(e) {
        var quantity = $('[class^=qty_room]');
        var countError = 0;
        for(i = 0; i < quantity.length; i++) {
            if($('.qty_room'+i).val() != 0) {
                countError++;
            }
        }
        if(countError > 0) {
            alert('Chức năng này hiện đang được nâng cấp!');
            return false;
        }
        else {
            alert('Bạn chưa chọn phòng!');
            return false;
        }
    });
</script>

<div class="left-section">
    <h2>Du Thuyền</h2>

    <div class="page-description">
        <div class="images-hotel">
            <img class="main-image" src="<?php echo $this->baseUrl('/public/files/boating/').$this->data['image']; ?>" />

            <div class="list-image">
                <?php if((count($this->image) > 0) || (count($this->room) > 0)) : ?>
                    <ul id="mycarousel" class="jcarousel-skin-tango">
                    <?php foreach($this->image as $value) : ?>
                        <li><img data-tooltip="sticky<?php echo $value['id']; ?>" src="<?php echo $this->baseUrl('/public/files/image/').$value['image']; ?>" width="70px" height="70px" /></li>
                    <?php endforeach; ?>
                    </ul>

                    <div id="mystickytooltip" class="stickytooltip">
                    <?php foreach($this->image as $value) : ?>
                        <div id="sticky<?php echo $value['id']; ?>" class="atip">
                            <img src="<?php echo $this->baseUrl('/public/files/image/').$value['image']; ?>" />
                            <div class="title-sticky"><?php echo $value['name']; ?></div>
                        </div>
                    <?php endforeach; ?>

                    <?php foreach($this->room as $value) : ?>
                        <div id="sticky1<?php echo $value['id']; ?>" class="atip" style="padding: 5px;">
                            <?php echo $value['description']; ?>
                        </div>
                    <?php endforeach; ?>
                    </div>
                <?php endif; ?>
            </div>
        </div>

        <?php $common = new Default_Model_Common(); ?>

        <div class="hotel-details">
            <p class="hotel-name"><?php echo $this->data['name']; ?></p>
            <p class="star-<?php echo $this->data['star']; ?>"></p>
            <p class="hotel-address">Địa chỉ: <?php echo $this->data['address']; ?></p>
            <?php if(!empty($this->sales)) : ?>
            <p class="sales-count">Khuyến mại giảm <?php echo $this->sales['sales']; ?>% giá phòng</p>
            <p class="sales-date">Chương trình áp dụng từ
                <?php echo $common->formatDate2($this->sales['start_date']); ?> đến
                <?php echo $common->formatDate2($this->sales['finish_date']); ?>
            </p>
            <?php endif; ?>
        </div>
    </div>

    <div class="page-description">
        <?php
            $count = count($this->room);
            if($count > 0) :
                $i = 0;
        ?>
        <form id="room-form" action="" method="post">
            <table class="list-room" cellspacing="0" cellpadding="0" border="0">
                <tr>
                    <th style="width: 280px;">Loại phòng</th>
                    <th style="width: 80px;">Tối đa</th>
                    <th style="width: 120px;">Giá 1 đêm</th>
                    <th style="width: 80px;">Số phòng</th>
                    <th style="width: 155px;">Đặt phòng</th>
                </tr>
                <?php foreach($this->room as $value) : ?>
                <tr>
                    <input type="hidden" name="room[]" value="<?php echo $value['id']; ?>" />
                    <td>
                        <p class="money"><?php echo $value['name']; ?></p>
                        <a class="room-description" style="cursor: pointer;" data-tooltip="sticky1<?php echo $value['id']; ?>">Xem chi tiết</a>
                    </td>
                    <td style="text-align: center;"><?php echo $value['max']; ?> người</td>
                    <td style="text-align: center;"><span class="money"><?php echo $common->formatMoney($value['price']); ?> đ</span></td>
                    <td style="text-align: center;">
                        <select name="qty_room[]" class="qty_room<?php echo $i; ?> input" style="width: 41px; height: 21px;">
                        <?php for($j = 0; $j <= 20; $j++) : ?>
                        <option value="<?php echo $j; ?>"><?php echo $j; ?></option>
                        <?php endfor; ?>
                        </select>
                    </td>
                    <?php
                        $i++;
                        if($i == 1) :
                    ?>
                    <td style="text-align: center;" rowspan="<?php echo $count; ?>">
                        <a href="" id="book-tour" class="button">Đặt phòng</a>
                    </td>
                    <?php endif; ?>
                </tr>
                <?php endforeach; ?>
            </table>
        </form>
        <?php endif; ?>
    </div>

    <?php if(!empty($this->sales)) : ?>
    <div class="content-list-first">
        <h3>Thông tin khuyến mại</h3>
        <p><?php echo $this->sales['description']; ?></p>
    </div>

    <div class="content-list">
        <h3>Giới thiệu về du thuyền</h3>
        <p><?php echo $this->data['description']; ?></p>
    </div>

    <?php else : ?>

    <div class="content-list-first">
        <h3>Giới thiệu về du thuyền</h3>
        <p><?php echo $this->data['description']; ?></p>
    </div>
    <?php endif; ?>

    <div class="content-list">
        <h3>Chính sách du thuyền</h3>
        <p><?php echo $this->data['policy']; ?></p>
    </div>

    <div class="content-list">
        <h3>Tiện nghi</h3>
        <p><?php echo $this->data['cozy']; ?></p>
    </div>

    <div class="content-list">
        <h3>Điều kiện hủy phòng</h3>
        <p><?php echo $this->data['condition']; ?></p>
    </div>
</div>

<?php echo $this->render('/right.phtml') ?>